<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<ui:composition xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                template="./index.xhtml"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://xmlns.jcp.org/jsf/core">
    <ui:define name="content">
        <div class="container-fluid">
            <h:form>
                <p:dataTable var="post" value="#{postManagement.postByCategory}" rows="10"
                             paginator="true" paginatorPosition="bottom"
                             paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                             rowsPerPageTemplate="5,10,15" styleClass="borderless hiddencss">
                    <p:column>
                        <div class="media">
                            <a class="pull-left" href="#">
                                <img class="media-object images img-border img-holder" 
                                     src="#{utilBean.contextPath}/resources/#{post.category.categoryType.imagePath}" alt="" />
                            </a>
                            <div class="media-body">
                                <a class="media-heading titleLink"
                                   href="#{utilBean.contextPath}/page/show-post.jsf?id=#{post.postId}" >
                                    #{post.title}
                                </a>
                                <br/>
                                <lable class="text text-info">#{msg['creator']} </lable>
                                <h:commandLink value="#{post.user.userName}" styleClass="userLink text-larger" action="#" />
                                <lable class="text text-info"> - #{postManagement.convertDate(post.updateDate)}</lable><br/><br/>
                                <p class="text text-justify postContent">
                                <h:outputText value="#{postManagement.subContent(post,500)}... " escape="false" />
                                <a class="text color-blue" href="#{utilBean.contextPath}/page/show-post.jsf?id=#{post.postId}">
                                    #{msg['read-more']}</a>
                                </p>
                            </div>
                        </div>
                    </p:column>
                </p:dataTable>
            </h:form>
        </div>
    </ui:define>
</ui:composition>
